﻿@{
    ViewBag.Title = "我的相册";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<el-row :gutter="20">
    <el-col :span="4" class="imagebox" v-for="(album,index) in cardData" :key="album.AlbumName" style="cursor:pointer;" @@click="files(album.AlbumId)">
        <el-card :body-style="{ padding: '0px' }" style="padding: 14px;">
            <img src="http://element-cn.eleme.io/static/hamburger.50e4091.png" class="image">
            <div style="padding: 14px 0 0 0;">
                <div style="text-align:left;"><span>{{album.AlbumName+'（'+album.FilesNumber+'）'}}</span></div>
                <div class="bottom clearfix">
                    <time class="time">{{ album.CreateTime}}</time>
                    <el-button type="text" class="button" style="margin-left:5px;" @@click="files(album.AlbumId)">查看</el-button>
                    <el-button type="text" class="button" @@click="delAlbum(album.AlbumId)">删除</el-button>
                </div>
            </div>
        </el-card>
    </el-col>
</el-row>
@section styles{
    <style>
        .el-main {
            padding: 30px 12%;
        }
    </style>
}
@section scripts{
    <script type="text/javascript">
        new Vue({
            el: "#app",
            data: {
                defaultalbum: '默认相册',
                dropalbums: [],
                limit: 10,
                ismultiple: false,
                isshowfilelist: true,
                activeIndex: '2',
                loging: false,
                cardData: []
            },
            methods: {
                handleSelect(key, keyPath) {
                    var self = this;
                    skipPage(self, key);
                },
                albums() {
                    var self = this;
                    Axios.get(self, '/main/albums', {
                        success(res) {
                            console.log(res)
                            self.cardData = res.data;
                        }
                    });
                },
                delAlbum(id) {
                    console.log(id)
                    var self = this;
                    showMessage(self, '提示：暂不支持删除相册.', true, 'warning');
                },
                files(albumId) {
                    console.log(albumId)
                    window.location.href = "/main/files?albumId=" + albumId;
                }
            },
            created() {
                var self = this;
                PF.dropdownalbums(self);
                self.albums();
            }
        });
    </script>
}

